package com.deluxelx.soul.inn.common.enums;

import lombok.Getter;

/**
 * 导航栏枚举类
 *
 * @author liaozihao
 * @date 2024-04-24 16:33
 */
@Getter
public enum NavbarEnum {

    XIN_LI_KE_PU("20240001", "心理科普"),
    HUN_LIAN_QING_GAN("20240002", "婚恋情感"),
    ZHI_CHANG_JI_NENG("20240003", "职场技能"),
    JIA_TING_GUAN_XI("20240004", "家庭关系"),
    REN_JI_SHE_JIAO("20240005", "人际社交");

    private final String code;

    private final String name;

    NavbarEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getCodeByName(String name) {
        for (NavbarEnum navbarEnum : NavbarEnum.values()) {
            if (navbarEnum.getName().equals(name)) {
                return navbarEnum.getCode();
            }
        }
        return null;
    }

    public static String getNameByCode(String code) {
        for (NavbarEnum navbarEnum : NavbarEnum.values()) {
            if (navbarEnum.getCode().equals(code)) {
                return navbarEnum.getName();
            }
        }
        return null;
    }

}
